package com.ruoyi.core.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.common.annotation.DataColumn;
import com.ruoyi.common.annotation.DataPermission;
import com.ruoyi.core.domain.Config;
import com.ruoyi.core.domain.vo.ConfigVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.gpt.domain.ChatToken;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * 身份标识Mapper接口
 *
 * @author ztx
 * @date 2023-03-16
 */
@Repository
public interface ConfigMapper extends BaseMapperPlus<ConfigMapper, Config, ConfigVo> {
    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id"),
        @DataColumn(key = "appid", value = "appid")
    })
    <P extends IPage<Config>> P selectPage(P page, @Param(Constants.WRAPPER) Wrapper<Config> queryWrapper);
    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id")
    })
    int updateById(@Param(Constants.ENTITY) Config entity);

    @Override
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id")
    })
    int deleteBatchIds(@Param(Constants.COLL) Collection<?> idList);
}
